package com.hqd527.qdshop.serviceproduct.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hqd527.qdshop.product.BaseTrademark;
import com.hqd527.qdshop.serviceproduct.mapper.BaseTrademarkMapper;
import com.hqd527.qdshop.serviceproduct.service.BaseTrademarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 太优秀
 * @date 2022/4/7 15:27
 * @description
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark> implements BaseTrademarkService {

    @Autowired
    private BaseTrademarkMapper baseTrademarkMapper;


    @Override
    public IPage<BaseTrademark> getTrademarkByPage(Long current, Long limit) {
        // 【封装分页参数pageParams】
        Page<BaseTrademark> pageParams = new Page<>(current,limit);

        // 封装查询条件
        QueryWrapper<BaseTrademark> baseTrademarkWrapper = new QueryWrapper<>();
        baseTrademarkWrapper.orderByDesc("id");

        // 查询列表
        return baseTrademarkMapper.selectPage(pageParams, baseTrademarkWrapper);

    }
}
